import { createBEM, BEM } from '@src/util/create/bem'
import { createComponent } from '@src/util/create/component'

type CreateNamespaceReturn = [
  ReturnType<typeof createComponent>,
  BEM
]

/**
 * @description: 创建命名空间
 * @param {string} name 名称
 * @return {CreateNamespaceReturn}
*/
export function createNamespace (name: string): CreateNamespaceReturn {
  name = 'plink-' + name
  return [createComponent(name), createBEM(name)]
}

/**
 * @description: 创建命名空间
 * @param {string} name 名称
 * @return {CreateNamespaceReturn}
*/
export function createNoPrefixNamespace (name: string): CreateNamespaceReturn {
  return [createComponent(name), createBEM(name)]
}
